package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.List;


/**
 * The persistent class for the "ROLE" database table.
 * 
 */
@Entity
@Table(name="\"ROLE\"")
@NamedQuery(name="Role.findAll", query="SELECT r FROM Role r")
public class Role implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="ROLE_ROLEID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ROLE_ROLEID_GENERATOR")
	@Column(name="ROLE_ID")
	private long roleId;

	@Column(name="ROLE_NAME")
	private String roleName;

	//bi-directional many-to-many association to Emppass
	@ManyToMany
	@JoinTable(
		name="RELATIONSHIP_110"
		, joinColumns={
			@JoinColumn(name="ROLE_ID")
			}
		, inverseJoinColumns={
			@JoinColumn(name="PASS_ID")
			}
		)
	@JSONField(serialize=false)
	private List<Emppass> emppasses;

	//bi-directional many-to-many association to Function
	@ManyToMany
	@JoinTable(
		name="RELATIONSHIP_111"
		, joinColumns={
			@JoinColumn(name="ROLE_ID")
			}
		, inverseJoinColumns={
			@JoinColumn(name="FUN_ID")
			}
		)
	@JSONField(serialize=false)
	private List<Function> functions;

	public Role() {
	}

	public long getRoleId() {
		return this.roleId;
	}

	public void setRoleId(long roleId) {
		this.roleId = roleId;
	}

	public String getRoleName() {
		return this.roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public List<Emppass> getEmppasses() {
		return this.emppasses;
	}

	public void setEmppasses(List<Emppass> emppasses) {
		this.emppasses = emppasses;
	}

	public List<Function> getFunctions() {
		return this.functions;
	}

	public void setFunctions(List<Function> functions) {
		this.functions = functions;
	}

}